<template>
  <div class="login">
    <div class="left">
      <div class="logo">
        <img src="@/assets/logo.png" alt />
        <span class="h1">黑马面面</span>
        <div class="line"></div>
        <span class="h2">用户登录</span>
      </div>
      <el-form>
        <el-form-item>
          <el-input placeholder="请输入手机号" v-model="user" prefix-icon="el-icon-user"></el-input>
        </el-form-item>
        <el-form-item>
          <el-input placeholder="请输入密码" show-password v-model="password" prefix-icon="el-icon-lock"></el-input>
        </el-form-item>
        <el-row>
          <el-col :span="16">
            <el-input placeholder="请输入验证码" v-model="code" prefix-icon="el-icon-key"></el-input>
          </el-col>
          <el-col :span="8">
            <img class="yzm" @click="getCode" :src="imgCode" alt />
          </el-col>
        </el-row>
        <el-form-item>
          <el-checkbox v-model="checked">
            我已阅读并同意
            <el-link type="primary" class="item4">用户协议</el-link>和
            <el-link type="primary" class="item4">隐私条款</el-link>
          </el-checkbox>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" class="btn">登录</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" class="btn">注册</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="right">
      <img src="@/assets/login.png" alt />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      checked: "",
      user: "",
      password: "",
      code: "",
      imgCode:'http://127.0.0.1:8080/heimamm/public/captcha?type=login'
    };
  },
  methods:{
    getCode(){
      this.imgCode=`http://127.0.0.1:8080/heimamm/public/captcha?${Math.random()*999}`
    }
  }
};
</script>

<style lang="less">
.login {
  display: flex;
  width: 100%;
  height: 100%;
  background: linear-gradient(#1493fa 28%, #01c6fa 96%);
  align-items: center;
  justify-content: space-around;
  .left {
    padding: 0 42px;
    width: 478px;
    height: 550px;
    background: #f5f5f5;
    .logo {
      margin: 48px 0 31px;
      display: flex;
      align-items: center;
      img {
        width: 22px;
        height: 17px;
      }
      .h1 {
        padding: 0 15px;
        font-size: 24px;
        font-family: SourceHanSansCN Regular, SourceHanSansCN Regular-Regular;
        font-weight: 400;
        text-align: left;
        color: #0c0c0c;
      }
      .h2 {
        padding: 0 15px;
        font-size: 22px;
        font-family: PingFangSC Regular, PingFangSC Regular-Regular;
        font-weight: 400;
        text-align: left;
        color: #0c0c0c;
      }
      .line {
        width: 1px;
        height: 28px;
        background: #c7c7c7;
      }
    }
    .el-input__inner {
      height: 44px;
    }
    .yzm {
      width: 100%;
      height: 45px;
      cursor: pointer;
    }

    .item4 {
      vertical-align: top;
    }
    .btn {
      width: 100%;
    }
  }
}
</style>